#include "main.h"


asteroid::asteroid(void)
{
}
asteroid::asteroid(double i)
{
	
		
			//randomize x,y,z values to later be used to determine the asteroid position
	        //by doing this the asteroid will look a little more chaotic
			x1=(rand()%50)/200.0;
			y1=(rand()%100-50)/1000.0;
			z1=(rand()%50)/200.0;
			//determine x,y and z position
			x=-0.5+3.5*(x1+sin(i));
			z=-0.5+3.5*(z1+cos(i));
			y=y1;
			//Nr of slices for the sphere
			x1=rand()%12;
			//Nr of stacks for the sphere
			z1=rand()%12;
		
}

asteroid::~asteroid(void)
{
}

void asteroid::draw()
{
	glPushMatrix();
	//set x,y,z position
	glTranslatef(x,y,z);
	//create a random shaped "sphere"
	glutSolidSphere(0.006, x1,z1);
    glPopMatrix();
}
